read -p "Which maker?" maker
echo Begin Running Checker!

g++ -O2 -std=c++17 -Wall -Wextra -DCHECK -DDEBUG -DLOCAL Checker.cpp -o "/tmp/CodeTmp/Checker"

if [ ${maker} == "cpp" ]
then
  g++ -O2 -std=c++17 -Wall -Wextra -DCHECK -DDEBUG -DLOCAL DataMaker.cpp -o "/tmp/CodeTmp/DataMaker"
fi

while [ "${?}" == "0" ]
do
  if [ ${maker} == "py" ]
  then
    python DataMaker.py
  else
    /tmp/CodeTmp/DataMaker
  fi
  \time -f "Exec: %U, Mem: %M" "/tmp/CodeTmp/Executable" | echo -en "\e[32m"
  \time -f "Checker: %U, Mem: %M" "/tmp/CodeTmp/Checker" | echo -en "\e[36m"
  diff -q /tmp/CodeTmp/checker.out /tmp/CodeTmp/testdata.out
done
